package architecture;

//JudgeZero
public class JudgeZero{
	MyInt src1;
	MyInt src2;
	MyInt opCode;
	MyInt result;
	void clockEvent(){
		if(opCode.i==0x2){
			result.i=1;
			return;
		}
		if(opCode.i==0x4){
			if(src1.i==src2.i)
				result.i=1;
			else result.i=0;
			return;
		}
		if(opCode.i==0x5){
			if(src1.i==src2.i)
				result.i=0;
			else result.i=1;
			return;
		}
		result.i=0;
	}
	
	public void dump() {
		System.out.println("--------");
		System.out.println("JudgeZero:");
		System.out.println("src1:"+src1);
		System.out.println("src2:"+src2);
		System.out.println("opCode:"+opCode);
		System.out.println("result:"+result);
		System.out.println("--------");
	}
}